/**
 * @Author Weton Li
 * @Date 2021/4/26 16:16
 */
public class Main3 {

    public static boolean method(String a,String b){
        // 为空和长度不同
        if (a == null || b == null || a.length() != b.length()) {
            return false;
        }

        int[] arrA = new int[100];
        int[] arrB = new int[100];
        for (int i = 0; i < a.length(); i++) {
            char charA = a.charAt(i);
            char charB = b.charAt(i);
            arrA[charA]++;
            arrB[charB]++;
        }

        for (int i = 0; i < 100; i++) {
            if (arrA[i]!=arrB[i]){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        String a = "abc";
        String b = "acb";
        System.out.println(method(a, b));
    }
}
